import { loadPlugin, loadPluginFn } from '../../app/config/loadplugin.config.js';

import wificollectIndexHtml from 'ngtemplate!html!../../../tpls/wificollect/wificollect.index.html';
import wificollectShareHtml from 'ngtemplate!html!../../../tpls/wificollect/wificollect.share.html';
import wificollectOpenHtml from 'ngtemplate!html!../../../tpls/wificollect/wificollect.open.html';
import wificollectTempHtml from 'ngtemplate!html!../../../tpls/wificollect/wificollect.temp.html';
import wificollectCacheHtml from 'ngtemplate!html!../../../tpls/wificollect/wificollect.cache.html';
import wificollectUessituatHtml from 'ngtemplate!html!../../../tpls/wificollect/wificollect.uessituat.html';

/**
 * SDK模块路由设置
 */
WificollectRouter.$inject = ['$stateProvider', '$urlRouterProvider', '$httpProvider', '$locationProvider', '$ocLazyLoadProvider'];
function WificollectRouter($stateProvider, $urlRouterProvider, $httpProvider, $locationProvider, $ocLazyLoadProvider) {

	//set router
    $stateProvider

		// 赛事管理
		.state('sdk.wificollect', {
			abstract: true,
		    url: '/wificollect',
		    data: { 
		        pageTitle: 'Share' 
		    },
		    templateUrl: wificollectIndexHtml,
		})

		// share
		.state('sdk.wificollect.share', {
		    url: '/share',
		    data: { 
		        pageTitle: 'Wifi收集-Share' 
		    },
		    templateUrl: wificollectShareHtml,
		    controller: 'ShareController',
		    resolve: {
		    	loadPlugin: loadPluginFn([loadPlugin.qrcode, loadPlugin.clipboard, loadPlugin.moment, loadPlugin.flot, loadPlugin.angles])
		    }
		})

		// share
		.state('sdk.wificollect.open', {
		    url: '/open',
		    data: { 
		        pageTitle: 'Wifi收集-Open' 
		    },
		    templateUrl: wificollectOpenHtml,
		    controller: 'OpenController',
		    resolve: {
		    	loadPlugin: loadPluginFn([loadPlugin.qrcode, loadPlugin.clipboard, loadPlugin.moment, loadPlugin.flot, loadPlugin.angles])
		    }
		})

		// share
		.state('sdk.wificollect.temp', {
		    url: '/temp',
		    data: { 
		        pageTitle: 'Wifi收集-Temp' 
		    },
		    templateUrl: wificollectTempHtml,
		    controller: 'TempController',
		    resolve: {
		    	loadPlugin: loadPluginFn([loadPlugin.qrcode, loadPlugin.clipboard, loadPlugin.moment, loadPlugin.flot, loadPlugin.angles])
		    }
		})

		// share
		.state('sdk.wificollect.cache', {
		    url: '/cache',
		    data: { 
		        pageTitle: 'Wifi收集-Cache' 
		    },
		    templateUrl: wificollectCacheHtml,
		    controller: 'CacheController',
		    resolve: {
		    	loadPlugin: loadPluginFn([loadPlugin.qrcode, loadPlugin.clipboard, loadPlugin.moment, loadPlugin.flot, loadPlugin.angles])
		    }
		})

		// share
		.state('sdk.wificollect.uessituat', {
		    url: '/uessituat',
		    data: { 
		        pageTitle: 'Wifi收集-WIFI使用情况' 
		    },
		    templateUrl: wificollectUessituatHtml,
		    controller: 'UessituatController',
		    resolve: {
		    	loadPlugin: loadPluginFn([loadPlugin.qrcode, loadPlugin.clipboard, loadPlugin.moment, loadPlugin.flot, loadPlugin.angles])
		    }
		})

}

export default WificollectRouter;